Carbon


SetDialogTimeout

Header: Dialogs.h Carbon status: Supported

Simulates an item selection in a modal dialog box after a specified amount of time elapses.

OSStatus SetDialogTimeout (
    DialogPtr inDialog, 
    SInt16 inButtonToPress, 
    UInt32 inSecondsToWait
);
inDialog

A pointer to the dialog box for which an item selection is to be simulated.

inButtonToPress

A signed 16-bit integer. Pass a value representing the number (within the item list) of the item that is to be selected.

inSecondsToWait

An unsigned 32-bit integer. Pass a value specifying the number of seconds that are to elapse before the Dialog Manager simulates an item selection. Pass 0 to clear a preexisting timeout value and cease the countdown in progress.

function result

A result code.

DISCUSSION

Your application calls the SetDialogTimeout function each time you wish to start a countdown of the specified duration for a given modal dialog box. When the amount of time specified in the inSecondsToWait parameter has elapsed, the Dialog Manager simulates a click on the button specified in the inButtonToPress parameter. If your application calls SetDialogTimeout again, or if any event is received for the dialog box, the countdown is restarted.

In order to use SetDialogTimeout with a given modal dialog box, your application must handle events for the dialog box through the ModalDialog function. The Dialog Manager will not simulate an item selection for the dialog box until ModalDialog processes an event (including null events).

Also see the function GetDialogTimeout.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when DialogsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by DialogsLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)